package cc.yugu.yhdw.common.domain.basic;

import cc.yugu.yhdw.common.annotation.Transient;
import cc.yugu.yhdw.common.constant.ConstEnum;
import cc.yugu.yhdw.common.domain.StringIdEntity;
import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * 用户押金记录实体
 *
 * @Date:Created in 2018/6/26 18:21
 * @Author:
 * @Modified By: zxj 2018/6/26 18:21
 */
public class CustomerForegiftOrder extends StringIdEntity {
    Integer foregiftType;           //押金类型
    String foregiftName;            //押金名称
    Integer price;
    Integer money;                     //金额 按分计
    Integer customerId;                //客户id
    String customerMobile;
    String customerFullname;
    Integer status;                 //1 未处理 2 已处理
    Date handleTime;                //处理时间
    Date createTime;
    String memo;                    //备注
    Date payTime;                   //支付时间
    Integer payType;                //支付类型
    Date applyRefundTime;           //申请退款时间
    Date refundTime;                //退款时间
    Integer refundMoney;            //退款金额
    String refundPhoto;             //退款照片
    String refundOperator;          //退款人

    Integer defaultQueryStatus;//

    // 新添加运营商、代理商属性
    @Transient
    Integer agentId,agencyId;

    public Integer getAgentId() {
        return agentId;
    }

    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    public Integer getAgencyId() {
        return agencyId;
    }

    public void setAgencyId(Integer agencyId) {
        this.agencyId = agencyId;
    }

    public enum ForegiftType {
        EXCHANGE_FOREGIFT(1, "换电押金"),
        ;

        private final int value;
        private final String name;

        ForegiftType(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();

        static {
            for (ForegiftType e : ForegiftType.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum Status {
        WAIT_PAY(1, "付款失败"),
        PAY_OK(2, "支付成功"),
        APPLY_REFUND(3,"申请退款"),
        REFUND_SUCCESS(4,"退款成功");

        private final int value;
        private final String name;

        Status(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();

        static {
            for (Status e : Status.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }
    /**
    * 返回押金类型名称
    * 
    * @Param: []
    * @Return: java.lang.String
    * @Author By: zjn 2018/7/25  10:58
    */ 
    public String getForegiftTypeName() {
        if(foregiftType != null) {
            return ForegiftType.getName(foregiftType);
        }
        return "";
    }


    public String getStatusName() {
        if(status != null) {
            return Status.getName(status);
        }
        return "";
    }

    public String getPayTypeName() {
        if(payType != null) {
            return ConstEnum.PayType.getName(payType);
        }
        return "";
    }

    public Integer getDefaultQueryStatus() {
        return defaultQueryStatus;
    }

    public void setDefaultQueryStatus(Integer defaultQueryStatus) {
        this.defaultQueryStatus = defaultQueryStatus;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getApplyRefundTime() {
        return applyRefundTime;
    }

    public void setApplyRefundTime(Date applyRefundTime) {
        this.applyRefundTime = applyRefundTime;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public String getCustomerMobile() {
        return customerMobile;
    }

    public void setCustomerMobile(String customerMobile) {
        this.customerMobile = customerMobile;
    }

    public String getCustomerFullname() {
        return customerFullname;
    }

    public void setCustomerFullname(String customerFullname) {
        this.customerFullname = customerFullname;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(Date handleTime) {
        this.handleTime = handleTime;
    }
    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getForegiftType() {
        return foregiftType;
    }

    public void setForegiftType(Integer foregiftType) {
        this.foregiftType = foregiftType;
    }

    public String getForegiftName() {
        return foregiftName;
    }

    public void setForegiftName(String foregiftName) {
        this.foregiftName = foregiftName;
    }
    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public Integer getRefundMoney() {
        return refundMoney;
    }

    public void setRefundMoney(Integer refundMoney) {
        this.refundMoney = refundMoney;
    }

    public String getRefundPhoto() {
        return refundPhoto;
    }

    public void setRefundPhoto(String refundPhoto) {
        this.refundPhoto = refundPhoto;
    }

    public String getRefundOperator() {
        return refundOperator;
    }

    public void setRefundOperator(String refundOperator) {
        this.refundOperator = refundOperator;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }


}
